using Admin.Application.Dto.User;
using Admin.Application.Repositories;
using Microsoft.AspNetCore.Mvc;

namespace Admin.Api.Controllers;

[ApiController]
[Route("api/[controller]")]
public class AuthsController(IAuthService authService) : ControllerBase
{
    private readonly IAuthService _authService = authService;

    [HttpPost("login")]
    public async Task<IActionResult> Login(AuthDto authDto)
    {
        var result = await _authService.LoginAsync(authDto);
        return Ok(result);
    }
    [HttpPost("register")]
    public async Task<IActionResult> Register(AuthDto authDto)
    {
        var result = await _authService.RegisterAsync(authDto);
        return Ok(result);
    }
}